package com.gome.ss.flowcrawl.extractor;

import java.util.HashMap;
import java.util.Map.Entry;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.lang.String;

public class HashDict
{
	private HashMap<String, Integer> mHashDict = new HashMap<String, Integer>();	
	public HashDict(){}
	
	public int add(String k)
	{
		if(mHashDict.containsKey(k))
			return mHashDict.get(k);
		
		int id = mHashDict.size();
		mHashDict.put(k, id);
		return id;
	}
	
	public int get(String k)
	{
		if(mHashDict.containsKey(k))
			return mHashDict.get(k);
		
		return -1;
	}
	
	public int size()
	{
		return mHashDict.size();
	}
}

